package gitee.derumin.lifeissohard.generate.recipes;

import gitee.derumin.lifeissohard.item.LishItems;
import net.minecraft.advancement.criterion.InventoryChangedCriterion;
import net.minecraft.data.server.recipe.CookingRecipeJsonBuilder;
import net.minecraft.data.server.recipe.RecipeJsonProvider;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.book.RecipeCategory;

import java.util.function.Consumer;

public class SmeltingSmokingBlastingAndCampfire {

    public static void generateSmeltingRecipes(Consumer<RecipeJsonProvider> exporter){
        CookingRecipeJsonBuilder.createSmelting(Ingredient.ofItems(Items.EGG),RecipeCategory.FOOD,LishItems.COOKED_EGG,0.1f,100)
                .group("add")
                .criterion("get_egg", InventoryChangedCriterion.Conditions.items(Items.EGG))
                .offerTo(exporter,"cooked_egg_from_smelting_egg");
    }

    public static void generateSmokingRecipes(Consumer<RecipeJsonProvider> exporter){
        CookingRecipeJsonBuilder.createSmoking(Ingredient.ofItems(Items.EGG),RecipeCategory.FOOD,LishItems.COOKED_EGG,0.1f,50)
                .group("add")
                .criterion("get_egg", InventoryChangedCriterion.Conditions.items(Items.EGG))
                .offerTo(exporter,"cooked_egg_from_smoking_egg");
    }

    public static void generateCampfireRecipes(Consumer<RecipeJsonProvider> exporter){
        CookingRecipeJsonBuilder.createCampfireCooking(Ingredient.ofItems(Items.EGG),RecipeCategory.FOOD,LishItems.COOKED_EGG,0.1f,300)
                .group("add")
                .criterion("get_egg", InventoryChangedCriterion.Conditions.items(Items.EGG))
                .offerTo(exporter,"cooked_egg_from_campfire_cooking");
    }
}
